<template>
  <!--我关注的歌手-->
  <div class="playlist" v-if="singer">
    <ul>
      <li v-for="(val,index) in singer" :key="index" @click="skipGrabble('GrabbleType100',val.id)">
        <showSinger :singerInfo='val'/>
      </li>
    </ul>
  </div>
</template>

<script>
import require from "requests/index";
import showSinger from "components/notbusiness/showSinger";
export default {
  name: "playlist",
  data() {
    return {
      singer: null
    };
  },
  components: {
    showSinger
  },
  methods: {
    getSinger() {
      require.getSinger(this.$store.state.userId).then(res => {
        this.singer = res.data.data;
      });
    },
    getId(id){
      console.log(id)
    },
    skipGrabble(path, val) {
      this.$router.push({
        name: path,
        query: {
          keyWord: val
        }
      });
    }
  },
  mounted() {
    this.getSinger();
  }
};
</script>

<style scoped lang='less'>
.playlist {
  width: 100%;
  ul {
    display: flex;
    flex-wrap: wrap;
  }
  li {
    margin: 15px 50px;
  }
}
</style>